POV-Ray : Newsgroups : povray.general : Testing whether a shape intersects with another : Testing whether a shape intersects with another Server Time
31 Jul 2024 04:22:07 EDT (-0400)
  Testing whether a shape intersects with another  
From: PhilipIsPDR
Date: 4 Nov 2007 09:00:00
Message: <web.472dcf35dc25d7085a2aacfe0@news.povray.org>
Does anyone know of a simple way to test whether one shape is inside another?

I'm looking to fill a random volume - say a radius 10 sphere, with other objects
randomly spaced about - say radius 1 spheres.  That's easily accomplished with
RAND and a loop with a test #if
(random1*random1)+(random2*random2)+(random3*random3) < 1 ...  then sphere is
inside and can be drawn.

Then I can make a hemisphere out of this object by amending the test to add an
#if random1 > 0, for example.


But what I'm really looking for is a way to make a transparent complex CSG
object, and then fill it with spheres or other objects using a test, "#if
inside_CSG_object".


Does anyone know a way of accomplishing this?  I've looked and looked, and I
realise I might be missing something very obvious...


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.